import { uniFetch } from './uni-fetch';

// 获取轮播图列表
export function getSwiper(data) {
	return uniFetch({
		url: '/miniApp/carousel/select/show',
		method: 'get',
		data
	});
}

// 获取通证走势
export function getEchartsData(data) {
	return uniFetch({
		url: '/miniApp/tokenTrend/select',
		method: 'get',
		data
	});
}

// 获取扶农商品列表
export function getFarmerCommodityList(data) {
	return uniFetch({
		url: '/miniApp/farmerCommodity/select',
		method: 'get',
		data
	});
}

// 获取展示消息
export function getMsg(data) {
	return uniFetch({
		url: '/miniApp/message/select/enable',
		method: 'get',
		data
	});
}

// 获取扶农商品信息
export function goExchangeById(data) {
	return uniFetch({
		url: '/miniApp/token/goExchange',
		method: 'get',
		data
	});
}

// 兑换商品
export function exchangeGoods(data) {
	return uniFetch({
		url: '/miniApp/token/exchange',
		method: 'post',
		data
	});
}
//获取通证兑换记录
export function getExchanged(data) {
	return uniFetch({
		url: '/miniApp/token/getExchanged',
		method: 'get',
		data
	});
}
//获取会员消费记录
export function getHistory(data) {
	return uniFetch({
		url: '/miniApp/member/getHistory',
		method: 'get',
		data
	});
}
//获取会员消费记录详情
export function getOrderDetails(data) {
	return uniFetch({
		url: '/miniApp/member/getOrderDetails',
		method: 'get',
		data
	});
}
//获取通证提现信息
export function getCashInfo(data) {
	return uniFetch({
		url: '/miniApp/member/getCashInfo',
		method: 'get',
		data
	});
}
//通证提现
export function withdraw(data) {
	return uniFetch({
		url: '/miniApp/member/TokenCashOut',
		method: 'post',
		data
	});
}

// 获取提现记录
export const reqWithdrawalRecords = data => uniFetch({ url: '/miniApp/member/cashOut/select', method: 'get', data });
